%% 看一看这个任务场景，给同学们一个直观的印象
clear;clc
%数据别忘了配置自己的路径
load('D:\Working_space\They Want\Liulaoshiyaoshiyan\course_experiment\Archive\experimental_data.mat')
startpos = [28.2213,112.9913,20]; %轨迹起始点

sat.satpos_sigma = 10; %设置卫星位置误差
sat.satvel_sigma = 0.1;  %设置卫星速度误差
sat = sat.add_satpos_res;  %添加误差到sat对象

my_tra2 = my_trajectory(startpos(1),startpos(2),startpos(3),sat.timerange,7); %生成接收机轨迹
figure
my_tra2.draw_trajectory(2); %画轨迹二维图
figure
my_tra2.draw_trajectory(5); %画轨迹三维图

sensors_dynamic = sensor_body_dynamic(my_tra2);
sensors_dynamic.angle_mask = 5;%设置仰角屏蔽值
sensors_dynamic = sensors_dynamic.get_sat_angle(sat);
sensors_dynamic.noise_obs = 1;
sensors_dynamic = sensors_dynamic.get_doppler_obs(sat);

my_tra2.draw_trajectory(4,sat); %画轨迹空间图，要动起来的话比较久，大概1分钟
% my_tra2.draw_trajectory(3);%不想看连线用这条命令

%% 画第一时刻天空图
startpos_ecef = lla2ecef(startpos);
satpos = sensors_dynamic.satpos_obs(1).satpos;
satpos = satpos(:,1:3);
recpos = startpos_ecef;
[az,ele] = azel_compute(satpos,recpos);
x = 1:length(satpos(:,1));
skyplot2(az,ele,length(satpos(:,1)));